package com.sgb.kjwl.view.ui.adapter.home;

import android.content.Context;
import android.view.View;

import com.sgb.kjwl.R;
import com.sgb.kjwl.databinding.ItemHomeCorporateWebsiteBinding;
import com.swgk.core.view.entity.EnterpriseRecEntity;
import com.sgb.kjwl.view.ui.activity.manage.WebsiteInfoActivity;
import com.sgb.kjwl.view.ui.adapter.map.BaseRecycleAdapter;
import com.sgb.kjwl.view.ui.adapter.map.ItemViewHolder;

import java.util.List;

public class CorporateWebsiteAdapter extends BaseRecycleAdapter<EnterpriseRecEntity> {

    public CorporateWebsiteAdapter(Context context, List<EnterpriseRecEntity> data) {
        super(context, R.layout.item_home_corporate_website, data);
    }

    @Override
    public void convert(ItemViewHolder holder, EnterpriseRecEntity entity) {
        ItemHomeCorporateWebsiteBinding binding = (ItemHomeCorporateWebsiteBinding) holder.getmBinding();
        binding.tvCompanyContent.setText(entity.getCompanyName());
        holder.itemView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                WebsiteInfoActivity.start(context, entity.getCompanyNo(), WebsiteInfoActivity.WEBSITE_FOR_COMPANY);
            }
        });
    }
}
